[data-type="submit"] {
  & .formkit-input {
    background: var(--fk-ui-color);
    border: 1px solid transparent;
    color: white;

    &:hover {
      filter: brightness(0.9);
    }

    &:active {
      filter: brightness(1.1);
    }

    &[disabled] {
      background: var(--fk-color-border);
    }
  }
}

[data-type="button"] {
  & .formkit-input {
    border: 1px solid var(--fk-color-border);

    &:hover {
      background-color: var(--fk-color-button-hover);
    }
  }
}

.formkit-outer[data-disabled] {
  opacity: .5;

  &:not([data-type="checkbox"]):not([data-type="radio"]):not([data-type="range"]) {
    & .formkit-inner {
      background-color: var(--fk-color-disabled);
    }
  }
}

[data-type="button"],
[data-type="submit"] {
  & .formkit-wrapper {
    max-width: 25em;
  }

  & .formkit-input {
    appearance: none;
    border-radius: var(--fk-border-radius);
    cursor: pointer;
    display: inline-flex;
    width: auto;
    justify-content: center;
    padding: 0.75em 2em;
    position: relative;
    transition: background-color 0.25s;

    &::before {
      box-sizing: border-box;
      content: "";
      width: 0;
      margin-right: 0;
      height: 1.28571428em;
      border: 0 solid transparent;
      border-radius: 1.28571428em;
      transition: width 0.25s, border 0.25s, margin-right 0.25s;
    }

    &[data-loading] {
      background-color: var(--fk-ui-thin);
      pointer-events: none;

      &::before {
        animation: fk-rotate 0.5s linear infinite;
        width: 1.28571428em;
        border: 0.1428571429em solid white;
        border-right-color: transparent;
        margin-right: 0.75em;
      }
    }

    &:focus-visible {
      border-color: var(--fk-color-border-focus);
    }
  }
}

.formkit-form {
  & > .formkit-messages {
    margin: 1em 0;
  }
}

@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}

[data-type="textarea"] textarea {
  min-width: 100%;
  min-height: 6em;
  line-height: 1.33;
  font-family: inherit;
}
